package com.guli.mall.pms.service.impl;
/*
 * @Author 罗俊
 * @date 2020/12/1 - 2:03 下午
 *
 */

import com.guli.mall.pms.feign.AliOssFeignClient;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
@Service
public class AliOssServiceImpl {

    @Resource
    AliOssFeignClient aliOssFeignClient;


    private static String ALI_OSS_IMG_PREFIX ;

    public String getAliOssImgPrefix() {

        if(StringUtils.isEmpty(ALI_OSS_IMG_PREFIX)){
            synchronized (SpuInfoServiceImpl.class){
                if(StringUtils.isEmpty(ALI_OSS_IMG_PREFIX)) {
                    ALI_OSS_IMG_PREFIX = aliOssFeignClient.getOssHost().get("host") + "/";
                }
            }
        }

        return ALI_OSS_IMG_PREFIX;
    }
}
